Core offload parameters
-ngl / —gpu-layers
Offload the first N transformer layers to VRAM. Pass999 to offload everything:
-ot / —override-tensor
Override where individual tensors are stored using regular expressions. This is the most powerful offload control available, particularly useful for MoE models where you want experts in RAM and everything else in VRAM.= is a regex matched against tensor names. The value after = is the target device (CPU, CUDA0, CUDA1, etc.).
Tensor names follow the pattern
blk.N.tensor_name. Run gguf_dump.py on your model to list all tensor names and identify the right regex pattern.—fit / —fit-margin
Automatically load as many tensors as available VRAM permits, without specifying an explicit layer count.Multi-GPU configuration
- Single GPU
- Multi-GPU
For a single GPU, use Use
-ngl 999 to fully offload, or a lower number for partial offload:-mg to select which GPU to use when multiple are present but you only want one:MoE-specific offload options
For Mixture-of-Experts models, ik_llama.cpp provides dedicated parameters to control where expert weights live:Per-operation offload control
-op / --offload-policy gives fine-grained control over which GGML operations run on GPU:
CUDA fine-tuning
-cuda / --cuda-params accepts a comma-separated list of CUDA-specific tuning options, including fusion control, GPU offload threshold, and MMQ-ID threshold:
Practical examples
Related pages
- Hybrid CPU/GPU inference — Detailed guide for running models that don’t fit in VRAM
- Parameters reference — Full GPU offload parameter reference